import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

import { BlogComponent } from './blog/blog.component';
import { BlogNewComponent } from './blog/component/blog-new/blog-new.component';
import { BlogDetailComponent } from './blog/component/blog-detail/blog-detail.component';
import { BlogEditComponent } from './blog/component/blog-edit/blog-edit.component';

const routes: Routes = [
  { path: '', redirectTo: '/blogs', pathMatch: 'full' },
  { path: 'blogs', component: BlogComponent },
  { path: 'blog', component: BlogNewComponent },
  { path: 'blog/edit/:id', component: BlogEditComponent },
  { path: 'blog/:id', component: BlogDetailComponent },
];

@NgModule({
  imports: [ RouterModule.forRoot(routes) ],
  exports: [ RouterModule ]
})
export class AppRoutingModule { }
